//
//  SEGElevatorControlHeader.m
//  SEGIntelligentHardware
//
//  Created by 乔杨 on 2020/5/7.
//

#import "SEGElevatorControlHeader.h"

CGFloat const kSEGElevatorControlHeader_H = 50.f;

@interface SEGElevatorControlHeader ()

/// title
@property (nonatomic, strong) UILabel *titleLab;

@end

@implementation SEGElevatorControlHeader

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = kColor_W;
        [self addSubview:self.titleLab];
    }
    return self;
}
- (void)refreshCellWithTitle:(NSString *)title {
    self.titleLab.text = title ?: @"";
}

#pragma mark - Getter
- (UILabel *)titleLab {
    if (!_titleLab) {
        CGRect rect = CGRectMake(15, 0, kScreenWidth-30, kSEGElevatorControlHeader_H);
        _titleLab = [[UILabel alloc] initWithFrame:rect];
        _titleLab.backgroundColor = kColor_W;
        _titleLab.textColor = kColor_1;
        _titleLab.layer.masksToBounds = YES;
        _titleLab.font = [UIFont boldSystemFontOfSize:15.f];
    }
    return _titleLab;
}

@end
